import time
def sortir(name):
    f = open(name)
    sp = [int(el.strip()) for el in f.readlines()]
    start = time.time()
    n = len(sp)
    for i in range(n - 1):
        for j in range(n - i - 1):
            if sp[j] < sp[j + 1]:
                sp[j], sp[j + 1] = sp[j + 1], sp[j]
    finish = time.time()
    print(name, round((finish - start) * 1000), 'milliseconds')
sortir('m1_sorted.txt')
sortir('m2_reverse.txt')
sortir('m3_shuffle.txt')